package com.saxion.conc;

import java.util.ArrayList;


public class OnePointOne implements Runnable{
	
	long				startTime;
	ArrayList<Integer>	numberArray	= new ArrayList<Integer>();
	
	
	public OnePointOne( ArrayList<Integer> numberArray ) {
		this.numberArray = numberArray;
	}
	
	
	@Override
	public void run() {
		try{
			startTime = System.nanoTime();
			ArrayList<Integer> sortedList = new ArrayList<Integer>();
			sortedList.add( numberArray.get( 0 ) );
			for( int i = 1; i < numberArray.size(); i++ ){
				for( int j = sortedList.size() - 1; j >= 0; j-- ){
					if( sortedList.get( j ) < numberArray.get( i ) ){
						sortedList.add( j + 1, numberArray.get( i ) );
						j = -1;
					}
				}
				
			}
			System.out.print( "1.1: Completed in " + ( System.nanoTime() - startTime ) / 1000000 + " ms\t" );
		} catch( Exception e ){
			e.printStackTrace();
		}
		// return numberArray;
	}
}
